<!-- 
	스터디장이 스터디에 가입신청한 사람들을 수락하는 뷰
	수락했을때  AcceptAction.Study 로 해당 memId와 현재 studyId를 보낸다.
	그리고 현재 페이지로 돌아와야 하며 조금전 수락한 멤버는 userList에 없어야 한다.
	
	수정할 사항
 -->

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="java.util.*" %>
<%@ page import="model.*" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0 maximum-scale=1.0, user-scalable=no" />
	<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
	<link rel="stylesheet" href="css/questudy.css" />
	
	<script src="http://code.jquery.com/jquery.js"></script>
	<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
	<script src="js/questudy.js" ></script>
	<script src="js/manageStudy/manageStudy.js"></script>
<title>Welcome to Questudy</title>
</head>
<%
	ArrayList<Participation> partList = new ArrayList<Participation>();
	ArrayList<String> memIdList = new ArrayList<String> ();
	if(request.getAttribute("participationList") != null)
		partList = (ArrayList<Participation>)request.getAttribute("participationList");
	if(request.getAttribute("memIdList") != null)
		memIdList = (ArrayList<String>)request.getAttribute("memIdList");
	int studyId = ((Integer)request.getAttribute("studyId")).intValue();
%>
<body>
	<jsp:include page="/nav/nav_main.jsp"></jsp:include>
	<jsp:include page="/nav/nav_study.jsp"></jsp:include>
	<div class="conatiner firstDiv">
		<div class="col-md-6 col-lg-6 col-md-offset-3 col-lg-offset-3">
			<div class="table-responsive">
				<table class="table table-hover">
					<tr>
						<th>ID</th>
						<th>이름</th>
					</tr>
					<% for(int i=0; i < partList.size(); i++) { %>
						<tr>
							<td><%= memIdList.get(i) %></td>
							<td><%= partList.get(i).getIsConfirmed() %></td>
							<td><button class="btn btn-default" id='<%= memIdList.get(i) %>' 
										onclick="allowJoin(this, '<%= studyId %>')">수락</button></td>
						</tr>
					<% } %>
				</table>
			</div>
		</div>
	</div>
</body>
</html>